import request from './request'

export function registerFun(data) {
  return request({
    url:'/api/nengliang/auth/register',
    method: 'post',
    data
  })
}

export function loginFun(data) {
  return request({
    url: '/api/nengliang/auth/login',
    method: 'post',
    data
  })
}

export function mobileCodeLogin(data) {
  return request({
    url: '/api/auth/mobileCodeLogin',
    method: 'post',
    data
  })
}

export function getMobileCode(mobile, type) {
  return request({
    url: '/api/nengliang/auth/sendCode',
    method: 'get',
    data: {
      mobile,
      type
    }
  })
}

export function resetPassword(data) {
  return request({
    url: '/api/nengliang/auth/resetPassword',
    method: 'post',
    data
  })
}

export function storeList(keyword) {
  return request({
    url: '/api/nengliang/store/list',
    method: 'get',
    data: {
      keyword
    }
  })
}

export function goodsList(storeId) {
  return request({
    url: '/api/nengliang/goods/list',
    method: 'get',
    data: {
      storeId
    }
  })
}

export function goodsInfo(id) {
  return request({
    url: '/api/nengliang/goods/info',
    method: 'get',
    data: {
      id
    }
  })
}

export function saveOrder(data) {
  return request({
    url: '/api/nengliang/order/saveOrder',
    method: 'post',
    data
  })
}

export function jscode2session(code) {
  return request({
    url: '/api/nengliang/wechat/jscode2session',
    method: 'post',
    data: {
      code
    }
  })
}

export function micropay(data) {
  return request({
    url: '/api/nengliang/wechat/micropay',
    method: 'post',
    data
  })
}

export function userInfo() {
  return request({
    url: '/api/nengliang/h5user/info',
    method: 'get',
  })
}

export function userApp() {
  return request({
    url: '/api/nengliang/h5user/app',
    method: 'get',
  })
}

export function verifyList(storeId) {
  return request({
    url: '/api/nengliang/order/verifyList',
    method: 'get',
    data: {
      storeId
    }
  })
}

export function orderVerify(storeId, verifyType) {
  return request({
    url: '/api/nengliang/order/verify',
    method: 'post',
    data: {
      storeId,
      verifyType
    }
  })
}

export function mapLocation(from) {
  return request({
    url: '/api/nengliang/map/getBylocation?from=' + from,
    method: 'get'
  })
}

export function cardList(storeId) {
  return request({
    url: '/api/nengliang/card/list',
    method: 'get',
    data: {
      storeId
    }
  })
}

export function activation(data) {
  return request({
    url: '/api/nengliang/card/activation',
    method: 'post',
    data
  })
}

export function cardInfo(cardNum) {
  return request({
    url: '/api/nengliang/card/info',
    method: 'get',
    data: {
      cardNum
    }
  })
}

export function cardVerify(storeId, cardNum) {
  return request({
    url: '/api/nengliang/card/verify',
    method: 'get',
    data: {
      cardNum,
      storeId
    }
  })
}

export function storeAdd(data) {
  return request({
    url: '/api/nengliang/store/add',
    method: 'post',
    data
  })
}

export function managerAdd(data) {
  return request({
    url: '/api/nengliang/manager/add',
    method: 'post',
    data
  })
}

export function guideAdd(data) {
  return request({
    url: '/api/nengliang/guide/add',
    method: 'post',
    data
  })
}

export function addressList(data) {
  return request({
    url: '/api/nengliang/address/list',
    method: 'get',
  })
}

export function addressAdd(data) {
  return request({
    url: '/api/nengliang/address/add',
    method: 'post',
    data
  })
}

export function addressUpdate(data) {
  return request({
    url: '/api/nengliang/address/update',
    method: 'post',
    data
  })
}

export function addressDelete(id) {
  return request({
    url: '/api/nengliang/address/delete',
    method: 'get',
    data: {
      id
    }
  })
}

export function addressInfo(id) {
  return request({
    url: '/api/nengliang/address/info',
    method: 'get',
    data: {
      id
    }
  })
}

export function base64Upload(base64Data) {
  return request({
    url: '/api/file/base64Upload',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: {
      base64Data
    }
  })
}

export function h5userInfo(faceImage) {
  return request({
    url: '/api/nengliang/h5user/info',
    method: 'get',
  })
}

export function commissionVerifyList(status) {
  return request({
    url: '/api/nengliang/commissionVerify/list',
    method: 'get',
    data: {
      status
    }
  })
}

export function commissionVerifyVerify(data) {
  return request({
    url: '/api/nengliang/commissionVerify/verify',
    method: 'post',
    data
  })
}

export function commissionLogList() {
  return request({
    url: '/api/nengliang/commissionLog/list',
    method: 'get',
  })
}

export function commissionLogTotal() {
  return request({
    url: '/api/nengliang/commissionLog/total',
    method: 'get',
  })
}

export function transferList() {
  return request({
    url: '/api/nengliang/transfer/list',
    method: 'get',
  })
}

export function transferApply(number) {
  return request({
    url: '/api/nengliang/transfer/apply',
    method: 'post',
    data: {
      number
    }
  })
}

export function checkIdMatrix(id) {
  return request({
    url: '/api/nengliang/commissionVerify/checkIdMatrix',
    method: 'get',
    data: {
      id
    }
  })
}

export function checkFromIdMatrix(data) {
  return request({
    url: '/api/nengliang/commissionVerify/checkFromIdMatrix',
    method: 'get',
    data
  })
}

export function getLiveCode() {
  return request({
    url: '/api/nengliang/account/getLiveCode',
    method: 'get'
  })
}